// src/features/workspaces/api/use-get-workspace.ts
import {MARK_DATA_URL} from "@/lib/social/constants";

interface Props {
    id: string
}

export const useGetWorkspace = async ({id}: Props) => {
    const res = await fetch(
        // `${MARK_DATA_URL}/workspaces/${id}`,
        `/api/workspaces/${id}`,
    )
    let data = await res.json()
    // data = data.workspace
    const isLoading = data === undefined

    return {data, isLoading}
}